#清除一小时前已经过期的token
from util.myredis import r
import time

def deletetoken():
    #获取
    nowtime = int(time.time())-3600
    key = "logoutlist"
    res = r.sortedset_getbyscore(key,0,nowtime)
    for i in res:
        r.sortedset_delete(key,i.decode())
    #删除
